#!/usr/bin/python

import sys

cat_hash = {}

for eachLine in sys.stdin:
    eachLine =  eachLine.strip()

    category = eachLine.split("\t")[0]
    art_name = "\t".join(eachLine.split("\t")[1:])

    if(cat_hash.has_key(category) == False):
        cat_hash[category] = []
    
    cat_hash[category].append(art_name)

for eachCategory in cat_hash.keys():
    art_names = cat_hash[eachCategory]
    
    n = ""
    
    for eachArt in art_names:    
        if(eachArt.split("\t")[0] =="*"):
            n = eachArt.split("\t")[1]
            break

    for eachArt in art_names:
        if(eachArt.split("\t")[0] !="*"):
            print eachArt+"\t"+eachCategory+":"+n
